package test1;

import java.util.PriorityQueue;

public class TestDemo {

    public static void main2(String[] args) {
        //默认就是一个小堆
        PriorityQueue<Integer> priorityQueue=new PriorityQueue<>();
        priorityQueue.offer(12);
        priorityQueue.offer(3);
        priorityQueue.offer(15);
        System.out.println(priorityQueue.poll());//3
        System.out.println(priorityQueue.poll());//12
    }


    public static void main(String[] args) {
        int[] array={27,15,19,18,28,34,65,49,25,37};
        TestHeap testHeap=new TestHeap();
        testHeap.createBigHeap(array);
        testHeap.offer(80);
        System.out.println("=======");
        System.out.println(testHeap.poll());
        System.out.println(testHeap.poll());
    }
}
